﻿/*
 * 
 *	C# object representation of row in 'researchRepo.universities' table:
 *	
 *	Currently a simple mapping of all table columns to equivalent properties,
 *	though the class might be expanded to track appropriate relationships with other tables.
 * 
 */

namespace ResearchRepository.Models
{
	public class RRUniversity
	{
		public RRUniversity(int uID, string uName)
		{
			UnivId = uID;
			UnivName = uName;
		}
		public RRUniversity(RRUniversity source)
			:this(source.UnivId,
					source.UnivName)
		{}
		public RRUniversity(System.Data.IDataRecord source)
			:this((int) source["univID"],
					(string) source["univName"])
		{}

		// named alias for constructor, provides handle to simulate a function pointer to constructor
		public static RRUniversity construct(System.Data.IDataRecord source)
		{
			return new RRUniversity(source);
		}

		public int UnivId { get; set; }
		public string UnivName { get; set; }
	}
}